package com.wejoy.video.middle.station.data.enums.dict;

/**
 * 视频媒体库来源类型
 * Created by liuyu on 2018/6/4.
 */
public enum EnumVideoResLibSourceType {

    QI_NIU(1, "七牛")
    ;

    /**
     * 带参数构建函数.
     *
     * @param code
     *            the code
     * @param text
     *            the 文字描述
     */
    private EnumVideoResLibSourceType(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    /** 状态码. */
    private Integer code;

    /** 文字描述. */
    private String text;


    /**
     * Gets the 文字描述.
     *
     * @return the 文字描述
     */
    public String getText() {
        return text;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setText(String text) {
        this.text = text;
    }

    /**
     * 通过code获得该枚举类型
     * @param code
     * @return
     */
    public static EnumVideoResLibSourceType getByCode(Integer code) {
        EnumVideoResLibSourceType[] values = EnumVideoResLibSourceType.values();
        for(EnumVideoResLibSourceType type : values) {
            if(type.code == code) {
                return type;
            }
        }
        return null;
    }
}
